<template>
  <div class="maritimeAdd">
    <div class="flex-center nav">
      <div class="nav-text">{{ router.query.detailed }}</div>
      <div class="nav-cum">测试</div>
      <el-divider direction="vertical" />
      <el-tag type="info" size="small" style="margin: 0 10px">LTL</el-tag>
      <el-tag type="success" size="small">已开船</el-tag>
    </div>
    <div>
      <el-tabs v-model="activeName" @tab-click="handleClick">
        <el-tab-pane
          v-for="item in optionsTabs"
          :key="item.name"
          :label="$t(item.label)"
          :name="item.name"
        ></el-tab-pane>
      </el-tabs>
    </div>
    <div style="padding: 0 10px; flex: 1; overflow: hidden">
      <component :is="componentMap[activeName]" />
    </div>
  </div>
</template>

<script setup >
import { ref, computed } from "vue";
import { useRoute } from "vue-router";
import entrust from "./entrust.vue";

defineOptions({
  name: "SeaMaritimeAdd",
});
// 创建组件映射对象，将字符串名称映射到实际组件
const componentMap = {
  entrust,
};

const activeName = ref("entrust");
const optionsTabs = [
  {
    label: "委托",
    name: "entrust",
  },
];

const router = useRoute();
const detailed = computed(() => router.currentRoute.value.query.detailed);
</script>

<style scoped lang="scss">
.maritimeAdd {
  width: 100%;
  height: 100%;
  background: #fff;
  display: flex;
  flex-direction: column;

  .nav-title {
    font-size: 20px;
    color: #333;
    font-weight: 500;
    padding: 15px 10px 10px;
    border-bottom: 1px solid #e4e4e4;
  }
}
.flex-center {
  display: flex;
  align-items: center;
}
.nav {
  padding: 17px 0;
  border-bottom: 1px solid #cccccc73;
  margin: 0 10px;
}
.nav-text {
  font-size: 17px;
  color: #000;
  font-weight: 500;
  margin-right: 10px;
}
.nav-cum {
  font-size: 13px;
  color: #757373;
  font-weight: 500;
}
</style>